package org.lintcode_Close.Stage1_Easy_50.O2判断语句;

/**
 * @Auther: qingle
 * @Date: 2024/8/17-2:47
 * @Description:
 * @version: 1.0
 */
public class 简单计算器 {

	public int calculate(int a, char op, int b) {
		// write your code here
		switch (op) {
			case '+':
				return a + b;
			case '-':
				return a - b;
			case '*':
				return a * b;
			case '/':
				return a / b;
			default:
				return 0;
		}
	}

	public static void main(String[] args) {

		System.out.println(new 简单计算器().calculate(1, '+', 2));
		System.out.println(new 简单计算器().calculate(1, '-', 2));
		System.out.println(new 简单计算器().calculate(1, '*', 2));
		System.out.println(new 简单计算器().calculate(1, '/', 2));
	}
}
